<template>
  <div ref="ProgressChart" class="ProgressChart" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'ProgressChart',
  mounted() {
    var myChart = echarts.init(this.$refs.ProgressChart)
    myChart.setOption({
      grid: {
        left: 0,
        right: 0
      },
      xAxis: {
        min: 0,
        max: 100,
        show: false
      },
      yAxis: {
        show: false,
        // 将X轴的数据项给到Y轴，从而让柱条以水平方向和呈现
        data: ['数据']
      },
      series: {
        type: 'bar',
        data: [78],
        // 设置柱条的宽度
        barWidth: 10,
        // 显示柱条的背景颜色
        showBackground: true,
        itemStyle: {
          color: 'pink'
        },
        // 设置刻度样式
        label: {
          show: true,
          formatter: '|',
          color: 'pink',
          position: 'right'
        }
      }
    })
  }
}
</script>

<style lang="scss" scoped>
.ProgressChart {
  width: 100%;
  height: 100%;
}
</style>
